/* =========================
   GLOBAL
========================= */
body {
  font-family: Calibri, sans-serif;
  background: #f6f7fb;
  margin: 0;
  color: #333;
}

h1, h2, h3, h4 {
  margin: 0 0 10px;
}

/* =========================
   HEADER / NAVIGATION
========================= */
header {
  font-family: 'Exo', sans-serif;
  background-color: #000;
  padding: 1rem 2rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  color: white;
}

.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.logo {
  font-size: 1.8rem;
  font-weight: 700;
  color: #4b4b4b;
}

nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

nav a {
  text-decoration: none;
  font-size: 1rem;
  color: #f1f904;
}

nav a:hover {
  text-decoration: underline;
}

.title-header {
  text-align: center;
  margin-top: 1rem;
}

.title-header h2 {
  font-size: clamp(1.8rem, 6vw, 3rem);
  color: #fff;
}

.hint {
  text-align: center;
  font-size: 1.1rem;
  margin-top: 0.5rem;
  color: #f1f904;
}

/* =========================
   TABS
========================= */
.tabs {
  display: flex;
  gap: 10px;
  margin: 30px auto 0;
  max-width: 80%;
  flex-wrap: wrap; /* erlaubt Umbruch auf kleinen Geräten */
  justify-content: center;
}

.tab {
  padding: 10px 20px;
  cursor: pointer;
  background: #e5e7eb;
  border-radius: 8px 8px 0 0;
  font-size: 16px;
  font-weight: 600;
  border: none;
  flex: 1 1 auto; /* flexibel, damit Tabs sich an Bildschirmbreite anpassen */
  text-align: center;
  min-width: 120px; /* verhindert zu kleine Buttons */
}

.tab.active {
  background: #2563eb;
  color: white;
}

/* =========================
   CONTENT / TASKS
========================= */
.task-container {
  display: none;
  background: #ffffff;
  padding: 30px;
  margin: 0 auto 30px;
  max-width: 80%;
  border-radius: 0 12px 12px 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tabs {
  padding-left: 20px;
  padding-right: 20px;
}

.task-container.active {
  display: block;
}

.reaction {
  font-weight: bold;
  font-size: 20px;
  margin: 20px 0;
}

.acidbase-box {
  margin-bottom: 10px;
}

.acidbase-box label {
  margin-right: 15px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 1.3em; 
}

.acidbase-box label.correct {
  background-color: #c8f7c5;
}

.acidbase-box label.incorrect {
  background-color: #f7c5c5;
}

.erklaerung {
  margin-top: 14px;        /* Abstand zum Erklärung-Button */
  padding: 12px 16px;     /* Innenabstand */
  font-size: 1.3rem;     /* etwas größere Schrift */
  line-height: 1.5;       /* bessere Lesbarkeit */
  background-color: #f4f7fa;
  border-left: 4px solid #4a90e2;
  border-radius: 6px;
  color: #333;
}

/* =========================
   TABLES
========================= */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  border-radius: 8px;
  overflow: hidden;
  table-layout: fixed; /* verhindert horizontal scroll */
}

th, td {
  border: 1px solid #ddd;
  padding: 10px;
  text-align: center;
  word-wrap: break-word;
}

th {
  background-color: #f0f0f0;
}

/* =========================
   INPUTS & FEEDBACK
========================= */
input[type="number"] {
  width: 80px;
  padding: 6px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  text-align: center;
  font-size: 14px;
}

.correct {
  background-color: #d4edda !important;
  border-color: #28a745;
}

.incorrect {
  background-color: #f8d7da !important;
  border-color: #dc3545;
}

.ph-input {
  margin: 15px 0;
  font-size: 1.2em;
}

.ph-input input {
  margin-left: 10px;
  width: 90px;
  padding: 4px;
  font-size: 1em;
}

/* =========================
   BUTTONS
========================= */
button {
  background: #2563eb;
  color: white;
  border: none;
  padding: 10px 18px;
  font-size: 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  width: auto;
}

button:hover {
  opacity: 0.9;
}

/* Scrollbare Tabs: Abstand & Hover */
.tabs div.tab {
  display: inline-block;
  cursor: pointer;
  padding: 10px 15px;
  margin-right: 3px;
  background-color: #e0e0e0;
  border-radius: 5px 5px 0 0;
  font-weight: bold;
  white-space: nowrap;
  transition: background-color 0.3s;
}

.tabs div.tab:hover {
  background-color: #d0d0d0;
}

.tabs div.tab.active {
  background-color: #2563eb;
  color: white;
}


/* =========================
   RESPONSIVE / MOBILE
========================= */
@media (max-width: 768px) {
  .tabs {
    flex-direction: column;
    gap: 8px;
    max-width: 95%;
  }

  .tab {
    min-width: unset;
    flex: 1 1 100%;
    font-size: 14px;
    padding: 8px 12px;
  }

  .task-container {
    padding: 20px 15px;
    max-width: 95%;
  }

  input[type="number"] {
    width: 60px;
    font-size: 13px;
    padding: 5px;
  }

  button {
    width: 100%;
    font-size: 15px;
    padding: 10px;
  }

  table th, table td {
    font-size: 12px;
    padding: 6px;
  }

  .reaction {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .title-header h2 {
    font-size: 1.8rem;
  }

  .hint {
    font-size: 1rem;
  }

  table th, table td {
    font-size: 11px;
    padding: 5px;
  }

  input[type="number"] {
    width: 50px;
    font-size: 12px;
  }

  .reaction {
    font-size: 14px;
  }
}
